    Help for FLabel

Properties            Events            Frequently Asked Questions

Registration Information

Order Form

Getting Custom Controls Written

Licensing Information

Description

FLabel is a label control that lets you format the text within it.  You can have different fonts, different colors, multiple paragraphs, paragraph formatting, etc.  Using properties, you can print your text.  All this and it's bound, too.

File Name

FLABEL1.VBX, FLABEL16.OCX, FLABEL32.OCX

ActiveX / OCX Object Name

Mabry.FLabelCtrl

ActiveX Compatility

VB 4.0 (32-bit) and 5.0

ActiveX Built With

Microsoft Visual C++ v4

ActiveX - Required DLLs

MFC40.DLL (October 6th, 1995 or later)

OLEPRO32.DLL  (October 6th, 1995 or later)

MSVCRT40.DLL  (September 29th, 1995 or later)

VBX Object Type

FLabel

VBX Compatibility

VB 2.0, 3.0 and 4.0 (16-bit)

VBX Built With

Microsoft Visual C++ v1.5

Distribution Note    When you develop and distribute an application that uses this control, you should install the control file into the user's Windows SYSTEM directory.  The control file has version information built into it.  So, during installation, you should ensure that you are not overwriting a newer version.


FLabel Property Page

Click on the dialog box (below) in the field you need help for.


FLabel Properties

Properties that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

*AutoSize Property

BackColor Property

*BackStyle Property

*Caption Property

DataChanged Property

DataField Property

DataSource Property

*Delimiter Property

DragIcon Property

DragMode Property

Enabled Property

FontBold Property

FontItal Property

FontName Property

FontSize Property

FontStrikethru Property

FontUnderline Property

ForeColor Property

Height Property

Index Property

Left Property

LinkItem Property

LinkMode Property

LinkTimeout Property

LinkTopic Property

MousePointer Property

Name Property

*ParaBefore Property

*ParaFirst Property

*ParaLeft Property

*ParaRight Property

Parent Property

*PrinterHDC Property

*PrinterHeight Property

*PrinterLeft Property

*PrinterScaleMode Property

*PrinterTop Property

*PrinterWidth Property

TabIndex Property

Tag Property

Top Property

*Version Property

Visible Property

Width Property

*WordWrap Property


FLabel Events

Events that have special meaning for this control or that only apply to this control are marked with an asterisk (*).

Click Event

DblClick Event

DragDrop Event

DragOver Event

LinkChange Event

LinkClose Event

LinkError Event

LinkOpen Event

MouseDown Event

MouseMove Event

MouseUp Event


Frequently Asked Questions

General Questions

Will FLabel justify text?

I would like to allow my users to format text using your FLabel control.  How can I do this?


FAQ - Will FLabel justify text?
Will FLabel justify text?

Frequently Asked Questions

No. FLabel only supports "left justification", which is sometimes known as "ragged right". FLabel will allow you to set margins, inter-line spacing, inter-paragraph spacing.  But, justification (right, center, or flush right) is not supported.


FAQ - I would like to allow my users to format text using your FLabel control.  How can I do this?
I would like to allow my users to format text using your FLabel control.  How can I do this?

Frequently Asked Questions

The formatting of FLabel is very powerful and there are many ways in which to control the formatting. It would be difficult to provide specific answers considering that each application is unique.

However, here are some general suggestions:

The Textbox control has SelStart and SelLength properties. Using these two properties, you can detect what text your users have highlighted. Then, use some other controls to automatically insert the formatting at the SelStart position and the SelStart+SelLength positions.

You could get very elaborate and create a Word-like toolbar for setting things like Bold, Italics, Underline, etc. Use combo boxes for setting Font names and sizes, etc.

If the text box contained "This is cool." and the user highlighted the word "cool". You could have a checkbox called Bold, that would automatically bold the word "cool" with the below code:

    Dim iStart, iLen As Integer

    If Text1.SelStart > 0 Then
        iStart = Text1.SelStart
        iLen = Text1.SelLength
        FLabel1.Caption = Left$(Text1.Text, iStart) & "|B:1|" & Mid$(Text1.Text, iStart + 1, iLen) & "|B:0|" & Right$(Text1.Text, Len(Text1.Text) - (iStart + iLen))
    End If

Obviously, you'd have to be able to un-Bold, etc., but this illustrates how one could create a very powerful toolbar that allows users to simply highlight text and then format it without needing to know all of the formatting codes.


Registration Information

CREDITS

FLabel was written by James Shields.

CONTACT INFORMATION

Orders, inquiries, technical support, questions, comments, etc. can be sent to mabry@mabry.com on the Internet.  Our mailing address/contact information is:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Sales: 1-800-99-MABRY (U.S. Only)

Voice: 206-634-1443

Fax: 206-632-0272 or 206-364-3196

Web: http://www.mabry.com

COST

The price of FLabel (control only) is US$20 (US$25 for International orders).  The cost of FLabel and the C/C++ source code (of the control itself) is US$50 (US$55 for International orders).

Prices are subject to change without notice.

DELIVERY METHODS

We can ship this software to you via air mail and/or e-mail.

Air Mail - you will receive disks, a printed manual, and printed receipt if you choose this delivery method.  The costs are:

US$5.00 	US Priority Mail

US$10.00 	AirBorne Express 2nd Day (US deliveries only)

US$15.00 	AirBorne Express Overnight (US deliveries only)

US$45.00 	International AirBorne Express.

E-Mail - We can ship this package to you via e-mail.  You need to have an e-mail account that can accept large file attachments (which includes CompuServe, AOL, and most Internet providers).  If you choose this option, please note: a printed manual is not included.  We will, however, e-mail a receipt to you.

Be sure to include your full mailing address with your order.  Sometimes (on the Internet) the package cannot be e-mailed, so we are forced to send it through the normal mails.

CompuServe E-Mail - CompuServe members can use the software registration forum (GO SWREG) to register this package.  FLabel's SWREG ID number is 4352.  The source code version's ID number is 4353.  PLEASE NOTE: When you order through SWREG, we send the registered package to your CompuServe account (not your Internet or AOL account) within a few hours.

ORDER / PAYMENT METHODS

You can order this software by phone, fax, e-mail, mail.  For your convenience, an order form has been provided that you can print out directly from this help file.

Please note that orders must include all information that is requested on our order form.   Your shipment WILL BE DELAYED if we have to contact you for additional information (such as phone number, street address, etc.).

You can pay by credit card (VISA, MasterCard, American Express), check (U.S. dollars drawn on a U.S. bank), cash, International Money Order, International Postal Order, Purchase Order (established business entities only - terms net 30), or wire transfer.

WIRE TRANSFER INFORMATION

Here is the information you need regarding our account for a wire funds transfer:

Bank Name: 	SeaFirst - Stone Way Branch

Bank Address: 	3601 Stone Way North

Seattle, WA  98103

Bank Phone: 	206-585-4951

Account Name: 	Mabry Software, Inc.

Routing Number: 	12000024

Account Number: 	16311706

If you are paying with a wire transfer of funds, please add US$12.50 to your order.  This is the fee that SeaFirst Bank charges Mabry Software.  Also, please ADD ANY ADDITIONAL FEES THAT YOUR BANK MAY CHARGE for wire transfer service. If you are paying with a  wire transfer, we must have full payment deposited to our account before we can ship your order.

Copyright © 1995-1997 by Mabry Software, Inc.


Order Form
 FLabel Order Form

Use the Print Topic... command from the File menu to print this order form.

Mail this 	Mabry Software, Inc.

form to: 	Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272 or 206-364-3196

Internet: mabry@mabry.com

Web: www.mabry.com

Where did you get this copy of FLabel?

____________________________________________________________________

Name: 	____________________________________________________________________

Ship to: 	____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

Phone: 	_________________________________________________________________

Fax: 	_________________________________________________________________

E-Mail: 	_________________________________________________________________

MC/VISA/AMEX: _________________________________________ exp. __________________

P.O. # (if any): 	____________________ Signature ____________________________________

qty ordered 	____ 	REGISTRATION
$20.00 ($25.00 international).  Check or money order in U.S. currency drawn on a U.S. bank.  Add $5.00 per order for shipping and handling.

qty ordered 	____ 	SOURCE CODE AND REGISTRATION
$50.00 ($55.00 international).  Check or money order in U.S. currency drawn on a U.S. bank.  Add $5.00 per order for shipping and handling.


Caption Example

In this example, the program allows you to play with formatting.  When you change the text in the edit box, it shows it in the FLabel.  To try this example, paste the code into the Declarations section of a form that contains an edit box and an FLabel control.  Press F5 and play with the edit box.

Sub Form_Load ()
    FLabel1.ParaBefore = 240
    FLabel1.ParaFirst = 480
    FLabel1.WordWrap = True

    Text1.Text = "This is a test of |color:blue|FLabel VBX|color:black|.  Play with this text to change the formatting.|cr|It's fun ..."
End Sub

Sub Text1_Change ()
    FLabel1.Caption = Text1.Text
End Sub


AutoSize Property See Also
See Also

Caption Property

WordWrap Property


BackStyle Property See Also
See Also

Caption Property


Caption Property See Also
See Also

Delimiter Property

ParaBefore Property

ParaFirst Property

ParaLeft Property

ParaRight Property


Delimiter Property See Also
See Also

Caption Property


ParaBefore Property See Also
See Also

Caption Property


PrinterHDC Property See Also
See Also

Caption Property

PrinterHeight Property

PrinterLeft Property

PrinterTop Property

PrinterWidth Property


PrinterLeft Property See Also
See Also

Caption Property

PrinterHDC Property

PrinterScaleMode Property


PrinterScaleMode Property See Also
See Also

Caption Property

PrinterHDC Property

PrinterHeight Property

PrinterLeft Property

PrinterTop Property

PrinterWidth Property


WordWrap Property See Also
See Also

AutoSize Property

Caption Property


AutoSize Property

See Also            Frequently Asked Questions

Description

Determines whether FLabel will automatically resize to display its text.

Syntax

object.AutoSize [= boolean ]

The syntax of the AutoSize property has these parts:

Part	   	Description

object	An FLabel control.

boolean	A boolean flag that determines whether FLabel will resize automatically.

Remarks

When this property is set to False, FLabel's size remains the same.  Text that would appear to the right or below the control is clipped at the edge of the control.

If this property is set to True, its behavior depends on the value of the WordWrap property.  When WordWrap and AutoSize are both True, FLabel adjusts its size vertically (only).  Paragraphs wrap at the right edge of the control.  FLabel's height increases to show all text in the Caption property.

When WordWrap is False and AutoSize is True, FLabel adjusts its size horizontally (only).  The control's width is set to the maximum width of a paragraph in the Caption property.

Data Type

Integer (boolean)


BackStyle Property

See Also            Frequently Asked Questions

Description

Determines whether the background is opaque or transparent.

Syntax

object.BackStyle [= integer ]

The syntax of the BackStyle property has these parts:

Part	   	Description

object	An FLabel control.

integer	An integer that specifies either a transparent or opaque background.

Remarks

This property allows you to make the control transparent or opaque.  When transparent, background settings (such as BackColor) have no effect.

This control may take the following values:

Constant	   	Value	   	Description

mFLabelTransparent	0	Transparent background

mFLabelOpaque	1	Opaque background

Data Type

Integer (enumerated)


Caption Property

See Also            Caption Example            Frequently Asked Questions

Description

Determines the text that is displayed.

Syntax

object.Caption [= string ]

The syntax of the Caption property has these parts:

Part	   	Description

object	An FLabel control.

string	A string expression that determines the displayed text and its formatting.

Remarks

This property determines what the control displays.  This can be comprised of both text and formatting commands.

Formatting codes are specified by enclosing them within delimiter characters (see the Delimiter property).  For example, to show the sentence "This is cool." with the word "cool" printed in blue, you would set the Caption property to:

This is |Color:Blue|cool|Color:Black|.

If you wanted to display "Mabry Software" on one line followed by "800-99-MABRY (toll free)" on the next, you would set the Caption property to:

Mabry Software|cr|800-99-MABRY (toll free)

You can print the delimiter character by putting it twice in the string.  For example, if the delimiter character is a dollar sign ($), and your Caption string is:

The price is $$35.00.

the output would be:

The price is $35.00

Here are all of the formatting codes for FLabel control:

Code	   	Meaning

B:boolean	Bold face (on or off, depending on the value of boolean)

BACK:color	Set the current background color.

BEFORE:twips	Set the vertical gap that precedes a paragraph (in twips).

BOLD:boolean	Bold face (on or off, depending on the value of boolean)

COLOR:color	Set the current foreground (text) color.

CR	Start new paragraph

FIRST:twips	Set first indent for a paragraph (in twips)

FONT:name	Change to new font, specified by name

FORE:color	Set the current foreground (text) color.

I:boolean	Italics (on or off, depending on the value of boolean)

ITAL:boolean	Italics (on or off, depending on the value of boolean)

LEFT:twips	Set left margin for a paragraph (in twips)

RIGHT:twips	Set the right margin for a paragraph (in twips).

S:boolean	Strikethru (on or off, depending on the value of boolean)

SIZE:points	Change font size, specified in points.

STRIKE:boolean	Strikethru (on or off, depending on the value of boolean)

U:boolean	Underline (on or off, depending on the value of boolean)

UNDER:boolean	Underline (on or off, depending on the value of boolean)

Twips values are just that: twips.  These are the units typically used in VB.

Boolean values are flexible.  "On", "True", "1", and "Yes" all count as "True".  "Off", "False", "0", and "No" all work as "False".

Color values can take one of two formats: direct RGB numbers, or a color name.  The format of RGB numbers is: 128,128,128 (i.e., in decimal, separated by commas).  Here are the color names and their associated RGB values that FLabel supports:

Code	   	Red	   	Green	   	Blue

Aqua	128	255	255

Black	0	0	0

Blue	0	0	255

Brown	128	64	0

Cyan	0	255	255

DkBlue	0	0	128

DkCyan	0	128	128

DkGray	128	128	128

DkGreen	0	128	0

DkRed	128	0	0

Gray	128	128	128

Green	0	255	0

LtBlue	128	128	255

LtGray	192	192	192

LtGreen	128	255	128

LtPurple	255	128	255

LtRed	255	128	128

Magenta	255	0	255

Purple	128	0	128

Red	255	0	0

Tan	128	128	0

White	255	255	255

Yellow	255	255	0

Any of these properties will take the special keyword "Default" or "D".  This will set that element back to its default value.  For example, if you had "Fore:D" at one point in the string, this would reset the text color to the color found in ForeColor.

The Size, Left, Right, First, and Before properties also take relative adjustments.  Just put a "+" or "-" in front of the number.  This will add or subtract the amount specified from the current setting.  So, if the current size of the font is 14 and you specify

|Size:+6|

then the font size will be 20.

Data Type

String


Delimiter Property

See Also            Frequently Asked Questions

Description

Determines the separator/specifier character for the formatting strings in the Caption property.

Syntax

object.Delimiter [= string ]

The syntax of the Delimiter property has these parts:

Part	   	Description

object	An FLabel control.

string	A character that determines the delimiter for the Caption property.

Remarks

This property determines the character that is used for the formatting string/code delimiter.  This property defaults to a vertical bar/pipe character: |

If multiple characters are specified, only the first is used.

Data Type

String


ParaBefore, ParaFirst, ParaLeft and ParaRight Properties

See Also            Caption Example            Frequently Asked Questions

Description

Determines the margins/gaps for the paragraph.

Syntax

object.ParaBefore [= twips ]
object.ParaFirst [= twips ]
object.ParaLeft [= twips ]
object.ParaRight [= twips ]

The syntax of the ParaBefore, ParaFirst, ParaLeft and ParaRight properties has these parts:

Part	   	Description

object	An FLabel control.

twips	A long integer that specifies a distance, in twips.

Remarks

These properties determine the margins and gaps for paragraph formatting.  ParaBefore is the amount of vertical space before each paragraph (except the first).  ParaFirst is the amount of horizontal space between the left edge of the control and the first line of a paragraph.  ParaLeft is the amount of space between the left edge of the control and any lines in a paragraph after the first.  And, ParaRight is the amount of space between the right edge of the control and the right edge of a paragraph.

These are the default settings for the control.  They can be overriden using various keywords in the Caption property.

Data Type

Integer (long)


PrinterHDC Property

See Also            Frequently Asked Questions

Description

Causes the control to be painted in the device handle specified (usually the printer object).

Syntax

object.PrinterHDC [= hdc ]

The syntax of the PrinterHDC property has these parts:

Part	   	Description

object	An FLabel control.

hdc	An integer that holds the device context handle (hDC) to paint into.

Remarks

When this property is set, the control paints itself into the Windows device context specified. Normally, this is used to print the control. To do this, use the hDC property of VB's Printer Object.

To print, make sure the Caption property is set correctly. Then, set the PrinterHeight, PrinterLeft, PrinterTop, and PrinterWidth properties. Finally, set PrinterHDC to Printer.hDC.

Data Type

Integer


PrinterHeight, PrinterLeft, PrinterTop and PrinterWidth Properties

See Also            Frequently Asked Questions

Description

Describes the area in which to paint the control when printing.

Syntax

object.PrinterHeight [= integer ]
object.PrinterLeft [= integer ]
object.PrinterTop [= integer ]
object.PrinterWidth [= integer ]

The syntax of the PrinterHeight, PrinterLeft, PrinterTop and PrinterWidth properties has these parts:

Part	   	Description

object	An FLabel control.

integer	An integer specifying distance.

Remarks

These properties describe where to place the control when printing. The coordinates used should be in the units specified by the PrinterScaleMode property.

To print, make sure the Caption property is set correctly. Then, set the PrinterHeight , PrinterLeft , PrinterTop , and PrinterWidth properties. Finally, set PrinterHDC to Printer.hDC.

Data Type

Integer (long)


PrinterScaleMode Property

See Also            Frequently Asked Questions

Description

Determines the units of measurement used by the PrinterLeft, PrinterTop, PrinterWidth, and PrinterHeight properties.

Syntax

object.PrinterScaleMode [= integer ]

The syntax of the PrinterScaleMode property has these parts:

Part	   	Description

object	An FLabel control.

integer	An integer specifying the new scale mode.

Remarks

This property determines what units to use for the properties describing the area in which to print. This property can be one of:

Constant	   	Value	   	Description

msSMPixel	0	Pixel (default, smallest unit of printer resolution)

msSMTwip	1	Twips (recommended, 1440 twips per inch)

msSMPoint	2	Point (72 points per inch)

msSMPixel	3	Pixel (smallest unit of printer resolution)

msSMCharacter	4	Character (12 per inch horizontally, 6 per inch vertically)

msSMInch	5	Inch

msSMMillimeter	6	Millimeter

msSMCentimeter	7	Centimeter

To print, make sure the Caption property is set correctly. Then, set the PrinterHeight, PrinterLeft, PrinterTop, and PrinterWidth properties. Finally, set PrinterHDC to Printer.hDC.

Data Type

Integer (enumerated)


Version Property

Frequently Asked Questions

Description

Shows the version of the control.

Syntax

object.Version

The syntax of the Version property has these parts:

Part	   	Description

object	An FLabel control.

Remarks

This property holds the current version of the control.  It is read-only and available at both design-time and run-time.

Data Type

String


WordWrap Property

See Also            Caption Example            Frequently Asked Questions

Description

Determines whether FLabel will wrap paragraphs to fit the width of the control.

Syntax

object.WordWrap [= boolean ]

The syntax of the WordWrap property has these parts:

Part	   	Description

object	An FLabel control.

boolean	A boolean flag that determines if paragraphs are wrapped to fit the width of the control.

Remarks

When this property is set to False, paragraphs of text that are displayed all on one line.  When AutoSize is False, this means that lines of text that are too wide for the control are clipped at the right edge of the control.  When AutoSize is True (and WordWrap is False), the control is widened to fit the widest paragraph.

See the AutoSize property for more information on the behavior of FLabel based on the values of the AutoSize and WordWrap properties.

Data Type

Integer (boolean)


Getting Custom Controls Written

If you or your organization would like to have custom controls written, you can contact us at the following:

Mabry Software, Inc.

Post Office Box 31926

Seattle, WA  98103-1926

Phone: 206-634-1443

Fax: 206-632-0272 or 206-364-3196

Internet: mabry@mabry.com

You can also contact Zane Thomas.  He can be reached at:

Zane Thomas

Post Office Box 121

Indianola, WA  98342

Internet: zane@mabry.com


Licensing Information

Legalese Version

Mabry Software grants a license to use the enclosed software to the original purchaser.  Copies may be made for back-up purposes only.  Copies made for any other purpose are expressly prohibited, and adherence to this requirement is the sole responsibility of the purchaser.

Customer written executable applications containing embedded Mabry products may be freely distributed, without royalty payments to Mabry Software, provided that such distributed Mabry product is bound into these applications in such a way so as to prohibit separate use in design mode, and that such Mabry product is distributed only in conjunction with the customers own software product.  The Mabry Software product may not be distributed by itself in any form.

Neither source code for Mabry Software products nor modified source code for Mabry Software products may be distributed under any circumstances, nor may you distribute .OBJ, .LIB, etc. files that contain our routines. This control may be used as a constituent control only if the compound control thus created is distributed with and as an integral part of an application.  Permission to use this control as a constituent control does not grant a right to distribute the license (LIC) file or any other file other than the control executable itself. This license may be transferred to a third party only if all existing copies of the software and its documentation are also transferred.

This product is licensed for use by only one developer at a time.  Mabry Software expressly prohibits installing this product on more than one computer if there is any chance that both copies will be used simultaneously.  This restriction also extends to installation on a network server, if more than one workstation will be accessing the product.  All developers working on a project which includes a Mabry Software product, even though not working directly with the Mabry product, are required to purchase a license for that Mabry product.

This software is provided as is.  Mabry Software makes no warranty, expressed or implied, with regard to the software.  All implied warranties, including the warranties of merchantability and fitness for a particular use, are hereby excluded.

MABRY SOFTWARE'S LIABILITY IS LIMITED TO THE PURCHASE PRICE.  Under no circumstances shall Mabry Software or the authors of this product be liable for any incidental or consequential damages, nor for any damages in excess of the original purchase price.

To be eligible for free technical support by telephone, the Internet, CompuServe, etc. and to ensure that you are notified of any future updates, please complete the enclosed registration card and return it to Mabry Software.

English Version

We require that you purchase one copy of a control per developer on a project.  If this is met, you may distribute the control with your application royalty free.  You may never distribute the LIC file.  You may not change the product in any way that removes or changes the requirement of a license file.

We encourage the use of our controls as constituent controls when the compound controls you create are an integral part of your application.  But we don't allow distribution of our controls as constituents of other controls when the compound control is not part of an application.  The reason we need to have this restriction is that without it someone might decide to use our control as a constituent, add some trivial (or even non-trivial) enhancements and then sell the compound control.  Obviously there would be little difference between that and just plain reselling our control.

If you have purchased the source code, you may not re-distribute the source code either (nor may you copy it into your own project).  Mabry Software retains the copyright to the source code.

Your license is transferable.  The original purchaser of the product must make the transfer request.  Contact us for further information.

The sample versions of our products are intended for evaluation purposes only.  You may not use the sample version to develop completed applications.